<template>
  <div class="main-con flex1 vbox">
    <div class="search-con">
      <el-form :model="searchParam" :inline="true" label-width="105px">
        <el-form-item label prop="commodityCode">
          <el-input v-model.trim="searchParam.commodityCode" @keyup.enter.native="search" placeholder="输入订单编号查询(多个按逗号分隔)"></el-input>
        </el-form-item>
        <el-form-item label prop="afterCode">
          <el-input v-model.trim="searchParam.afterCode" @keyup.enter.native="search" placeholder="输入转运单号查询(多个按逗号分隔)"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-search" type="primary" @click="search">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="vbox flex1">
      <base-table class="orderTable" ref="orderTable" url="order/getSimplePage" code="htk" :page-sizes="[35,40,50,70,80,100]" :selection="false" :param="searchParam" :cls="columns"></base-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    let me = this;
    return {
      searchParam: {},
      searchTimes: [],
      columns: [
        {
          prop: "commodityCode",
          label: "订单号",
          width: 120
        },
        {
          prop: "afterCode",
          label: "转运单号",
          width: 120
        },
        {
          prop: "senderName",
          label: "寄件人",
          width: 90
        },
        {
          prop: "recipientsName",
          label: "收件人",
          width: 90
        },
        {
          prop: "senderAddress",
          label: "发件地址"
        },
        {
          prop: "recipientsAddress",
          label: "收件地址"
        },
        {
          prop: "trackStrs",
          label: "轨迹跟踪"
        },
        // {
        //   prop: "state",
        //   label: "订单状态",
        //   width: 100,
        //   formatter(row) {
        //     let orderState = me.orderStates.find(item => {
        //       return item.value == row.state;
        //     });
        //     return !orderState ? "" : orderState.name;
        //   }
        // },
        { prop: "creationTime", label: "创建时间", width: 180 }
      ],
      orderStates: []
    };
  },
  created() {},
  methods: {
    search() {
      this.$refs["orderTable"].initLoad();
    },
    getOrderStates() {
      let me = this;
      me.$http.ajax({
        url: "sysDictData/getForSelect/order_state",
        success: res => {
          me.orderStates = res;
        }
      });
    }
  }
};
</script>

<style >
</style>
